<div class="findtrs" >
	<form action="" class="layui-inline layui-form" method="post" style="width: 100%;">
		<div class="ftitle">
			<div class="lt">
				<h2>实名认证(未完成提交)</h2>
			</div>
		</div>
		<div class="fremittanpred fbai" >
			<div class="list">
				<ul>
					<li style="padding-left: 20px;min-width: 550px;">
						<span id="XXX"></span><br />
						<span id="time_show" style="color: red;font-weight: bold;font-size: 18px;display: none">
							请在:
							<!--							<strong id="hour_show"><s id="h"></s>0时</strong>-->
							<strong id="minute_show"><s></s>00分</strong>
							<strong id="second_show"><s></s>00秒</strong>
							内完成提交
						</span>
					</li>

				</ul>
			</div>

		</div>
	</form>
	<div class="funaduibi fbai">
		<div class="fdbtable qmfdbtable ftable fboxbai">
			<table border="0" cellspacing="0" cellpadding="0" width="100%" id="dataTable">
			</table>
		</div>
	</div>
</div>
<script type="text/javascript">
	layui.use(['form','table'], function() {
		var form = layui.form,
				table = layui.table; //表格

		$("#time_show").show();
		timer("1800");
		$("#XXX").qrcode("{$url}");

		table.render({
			elem: '#dataTable',
			height: 'auto',
			cellMinWidth: '80',
			totalRow: true,
			method: 'post',
			url: "{:url('idList')}",
			id: 'dataTable1',
			text:{none: '无数据'},
			cols: [[
				{ type: 'numbers'},
				{ field: 'time', align: 'center', title: '时间' ,
					templet: function (d) {
						return layui.util.toDateString(d.time * 1000, "yyyy-MM-dd HH:mm:ss");
					}
				},
				{ field: 'name',align: 'center', title: '姓名'},
				{ field: 'is_rep',align: 'center', title: '审核结果'},
				{ field: 'remark',  align: 'left', title: '描述' },

			]],
			page: true,
			limit: 10,
			limits: [10],
		});
	});

	//更改验证码图片
	setCaptcha = function() {
		$('#captcha_ipt').val("");
		var timestamp = new Date().getTime();
		$('#captcha_img').attr('src', '{:url(\'verify/index\')}?' + timestamp);
	}

	var myTimer;
	var intDiff=1;
	$(document).ready(function() {
		index = setInterval("ajaxstatus()", 3000);
	});
	function ajaxstatus() {
		if(intDiff>0){
			var date = new Date();
			var timer = date.getTime().toString();
			$.ajax({
				url:"{:url('idCheckVef')}?t=" + timer,
				type: "GET",
				dataType: "json",
				success: function(res) {
					const check = res;
					if(check) { //订单状态为1表示支付成功
						layer.msg('身份认证成功.' , {time:1500});
						window.location.href = "{:url('user/account')}";
					}
				},
				error: function() {

				}
			});
		}
	}
	function timer(intDiff) {
		myTimer = window.setInterval(function () {
			var day = 0,
					hour = 0,
					minute = 0,
					second = 0;//时间默认值
			if (intDiff > 0) {
				day = Math.floor(intDiff / (60 * 60 * 24));
				// hour = Math.floor(intDiff / (60 * 60)) - (day * 24);
				minute = Math.floor(intDiff / 60) - (day * 24 * 60) - (hour * 60);
				second = Math.floor(intDiff) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60);
			}
			if (minute <= 9) minute = '0' + minute;
			if (second <= 9) second = '0' + second;
			// $('#hour_show').html('<s id="h"></s>' + hour + '时');
			$('#minute_show').html('<s></s>' + minute + '分');
			$('#second_show').html('<s></s>' + second + '秒');
			if (hour <= 0 && minute <= 0 && second <= 0) {
				intDiff = 0;
				window.location.href = "{:url('user/account')}";
				clearInterval(myTimer);
			}
			intDiff--;

		}, 2000);
	}
</script>